from django.db import models
from op_drf.base import BaseModel

# Create your models here.


class AssetInfo(BaseModel):
    asset_name = models.CharField(verbose_name="资产名称", max_length=100, null=True, blank=True)
    asset_code = models.CharField(verbose_name="资产编码", max_length=100, null=True, blank=True)
    use_year = models.IntegerField(verbose_name="使用年限", default=0)
    life_year = models.IntegerField(verbose_name="剩余使用年限", default=0)

    class Meta:
        db_table = "sys_assetinfo"
        # 排序方式
        # ordering = ["-id"]


class OperateInfo(BaseModel):
    model = models.CharField(verbose_name="模型",max_length=200,help_text="模型",null=True,blank=True)
    field = models.CharField(verbose_name="字段",max_length=100,help_text="字段",null=True,blank=True)
    zhujian = models.IntegerField(verbose_name="主键",help_text="主键",default=0)
    old_value = models.CharField(verbose_name="旧值",max_length=255,help_text="旧值",null=True,blank=True)
    new_value = models.CharField(verbose_name="新值",max_length=255,help_text="新值",null=True,blank=True)

    class Meta:
        db_table = "sys_operate_info"